/* 编辑器样式 */

/* 开始页面 */
#start_page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#start_page h1 {
    font-size: 72px;
    font-weight: 900;
    color: white;
    margin: 0;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

#start_page h3 {
    font-size: 24px;
    color: rgba(255,255,255,0.9);
    margin: 20px 0 0 0;
    font-weight: 300;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 工作区 */
#blocklyDiv {
    height: calc(100vh - 60px);
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* 主题选择器样式 */
.theme-selector {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.theme-selector:hover {
    background-color: #f3f4f6;
    transform: translateX(4px);
}

.theme-selector span {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-left: 8px;
    border: 2px solid #e5e7eb;
}

.theme-blue {
    background-color: #2196f3;
}

.theme-purple {
    background-color: #6d50f0;
}

.theme-black {
    background-color: #494949;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    z-index: 100;
}

.navbar ul {
    height: 100%;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 20px;
}

.navbar li {
    position: relative;
    margin-right: 10px;
}

.navbar b {

    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        height: 50px;
    }
    
    #blocklyDiv {
        height: calc(100vh - 50px);
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card {
        margin: 0;
    }
    
    .dropdown-menu {
        min-width: 160px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip.show {
    opacity: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 原有的样式保持兼容 */
#code {
    height: 900px;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: #1D1F21;
    color: white;
    overflow: scroll;
    padding: 50px;
    z-index: 999;
    font-family: consola, serif;
    display: inline;
}

/* 行号样式优化 */
#code pre.line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber;
}

#code pre.line-numbers > code {
    position: relative;
    white-space: inherit;
}

#code .line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    font-size: 100%;
    left: -3.8em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #999;
    user-select: none;
}

#code .line-numbers-rows > span {
    pointer-events: none;
    display: block;
    counter-increment: linenumber;
}

#code .line-numbers-rows > span:before {
    content: counter(linenumber);
    color: #999;
    display: block;
    padding-right: 0.8em;
    text-align: right;
}

#codefa {
    display: none;
}

div#look {
    height: 75%;
    position: absolute;
    top: calc(12.5% + 5px);
    left: 5.5%;
    width: 28.5%;
    outline: #E8EAEC solid 2px;
    border-radius: 14px;
    padding: 10px;
    background-color: #ffffff;
    box-shadow: 0 14px 18px rgba(0, 0, 0, 0.11);
}

div#look_pos {
    height: 70%;
    position: absolute;
    top: calc(15% + 5px);
    left: 14.5%;
    width: 22%;
    padding: 10px;
    opacity: 0;
}

div#code_list {
    position: absolute;
    top: calc(10% + 5px);
    left: 21%;
    background-color: #ffffff65;
    height: 1.5%;
    width: 8%;
    backdrop-filter: blur(20px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
    padding: 12px;
    gap: 24px;
    margin-bottom: 8px;
}

div#n {
    height: 1px;
    position: absolute;
    left: 1060px;
    top: 80px;
    width: 380px;
    background-color: pink;
    overflow: scroll;
    display: none;
    opacity: 0;
}

.blocklyTreeRowContentContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.blocklyTreeRow {
    height: initial;
}